import request from '/@/utils/request'

export function page(query?:Object){
    return request({
        url:'/customer/customer/page',
        method:'get',
        params:query
    });
}


export function getDetails(params:Object){
    return request({
        url:'/customer/customer/detail',
        method:'get',
        params
    });
}


export function addCostomer(data?: any){
    return request({
        url:'/customer/customer/add',
        method:'post',
        data:data
    })
}

export function updateCustomer(data?: any){
    return request({
        url:'/customer/customer/update',
        method:'put',
        data:data
    })
}

// 新增：检查手机号是否存在
export function checkTelExists(cusTel: string, cusId?: string) {
    return request({
        url: '/customer/customer/checkTel',
        method: 'get',
        params: { cusTel, cusId } // 传入手机号和当前客户ID（修改时）
    });
}

